Processing a unit of work

ABSTRACT

A client computer batch message transaction group is created that includes a set of client computers from which messages are committed as a batch messaging transaction to a single message reception queue. In response to receiving separate messages from at least two of the set of client computers within the client computer batch message transaction group, the separate messages are grouped under the batch messaging transaction as a single unit of work to commit to the single message reception queue. A single batch transaction commit decision is computed based upon whether a write of each of the separate messages grouped within the single unit of work to the single message reception queue is successful.

BACKGROUND

The present invention relates to a method for processing a unit of work.

In some edge connectivity scenarios it is necessary to connect a largenumber, typically tens of thousands, of client computers. These clientcomputers may need to perform updates to a server which are persistent,for example, reliably delivering messages to or from the server.

Typically, one thread per client waits for work from the client and whenwork is received, the server performs a disk force in a transactionspecific to the client.

Disk forces are expensive in that they cause delay and this problem iscompounded when disk forces occur for work from multiple clientcomputers. The system software may try to merge several disk forcestogether to mitigate this, at a cost of having to manage the merging ofdisk forces.

Further, this mechanism requires many threads to be active.

Both problems inhibit scalability, especially in the case where thereare many (e.g., tens of thousands) client computers.

SUMMARY

A method for processing a unit of work includes creating, at a servercomputer, a client computer group by selecting a subset of a pluralityof client computers, where each of the plurality of client computers hasa separate communication channel with the server computer; receiving amessage from at least one of the subset of the plurality of clientcomputers at the server computer; in response to receiving messages fromat least two of the subset of the plurality of client computers withinthe client computer group, grouping the messages under a single unit ofwork; and computing a single decision associated with the single unit ofwork for the client computer group, where each of the at least two ofthe subset of the plurality of client computers is operable to acceptthe single decision.

An apparatus for processing a unit of work includes a network interfaceand a processor programmed to create a client computer group byselecting a subset of a plurality of client computers, where each of theplurality of client computers has a separate communication channel withthe apparatus via the network interface; receive a message from at leastone of the subset of the plurality of client computers at the apparatusvia the network interface; responsive to receiving messages from atleast two of the subset of the plurality of client computers within theclient computer group, group the messages under a single unit of work;and compute a single decision associated with the single unit of workfor the client computer group, where each of the at least two of thesubset of the plurality of client computers is operable to accept thesingle decision.

A computer program product includes a computer readable storage mediumincluding computer readable program code, where the computer readableprogram code when executed on a computer causes the computer to create aclient computer group by selecting a subset of a plurality of clientcomputers, where each of the plurality of client computers has aseparate communication channel with the computer; receive a message fromat least one of the subset of the plurality of client computers at thecomputer; in response to receiving messages from at least two of thesubset of the plurality of client computers within the client computergroup, group the messages under a single unit of work; and compute asingle decision associated with the single unit of work for the clientcomputer group, where each of the at least two of the subset of theplurality of client computers is operable to accept the single decision.

BRIEF DESCRIPTION OF THE DRAWINGS

The present subject matter will now be described, by way of exampleonly, with reference to preferred embodiments thereof, as illustrated inthe following drawings:

FIG. 1 is a block diagram of an example of an implementation of a systemaccording to an embodiment of the present subject matter;

FIG. 2 is an additional block diagram of the system of FIG. 1 depictingseveral client computers having queues, operable to communicate with theserver computer according to an embodiment of the present subjectmatter; and

FIG. 3 is a flow chart an example of an implementation of a processoperable at a server device to perform processing associated withseveral client computer devices according to an embodiment of thepresent subject matter.

DETAILED DESCRIPTION

FIG. 1 is a block diagram of an example of an implementation of a system(100) in which the preferred embodiment may be implemented. There isshown a client computer (105) having a client application (110)including an associated queue (115) and a client middleware application(120) operable to manage the queue (115). In an example, the clientcomputer (105) may include an electricity meter and the clientapplication (110) is an application that produces messages includingelectricity readings.

It should be understood that, alternatively, the client application(110) may not have an internal queue. Rather, the production andconsumption of messages associated with the client application (110) maybe synchronous with a server application.

The client computer (105) is operable to communicate with a servercomputer (130) using a network (125). The server computer (130) executesa server application (145) including an associated queue (140) and aserver middleware application (135) operable to manage the queue (140).In an example, the server application (145) may include an applicationthat consumes messages including electricity readings and responsivelyproduces messages including, for example, an instruction (e.g., “shutdown”) to an appliance associated with the electricity meter.

There are typically three transactions involved in transferring messagesfrom one system to another. With reference to FIG. 1, “Transaction1” isassociated with the client application (110) storing a message on itsassociated queue (115) (e.g., where the queue (115) is local to theclient application (110)). “Transaction 2” is associated with thetransfer of the message from the client computer (105) to the servercomputer (130) using the network (125). It should be noted thatTransaction 2 is not under the direct control of the client application(110) within the present example. “Transaction 3” is associated withreceipt of the message at the server computer (130) in its associatedqueue (140) (e.g., where the queue (140) is local to the server computer(130)).

The preferred example is directed to processing associated withTransaction 2 as will be described herein.

FIG. 2 is an additional block diagram of the system (100) of FIG. 1depicting several client computers having queues, operable tocommunicate with the server computer (130). With reference to FIG. 2, inuse, there may be several (e.g., tens of thousands) of client computers(105) having queues, operable to communicate with the server computer(130).

FIG. 3 is a flow chart an example of an implementation of a process 300operable at a server device, such as the server computer (130), toperform processing associated with several (e.g., tens of thousands)client computer devices, such as the client computers (105). Withreference to FIG. 3, the transaction flows associated with a messageinbound to the server computer (130) is shown.

In a pre-processing step, a number of client applications (110) mayconnect to the server middleware application (135), wherein each clientapplication (110) has its own, separate communications channel andwherein each client application (110) sends a client identifier to theserver middleware application (135).

At step 301, the server middleware application (135) creates a group ofclient applications by selecting a number of connected clientapplications (110).

The server middleware application (135) stores client identifiers andassociated queue (115) identifiers of the selected client applications(110).

In one example, the group is created using any number of clientapplications (110). Preferably, a threshold value associated with anumber of groups is selected and the number of connected clientapplications (110) is divided among the threshold value of the number ofgroups.

Preferably, a single thread associated with the server middlewareapplication (135) is assigned to the group.

Each client application (110) in the group may produce one or moremessages which are written to the associated queues (115).

Each client middleware application (120) takes a copy of the messagefrom the queue (115). The message may be deleted from the queue (115) atthis point or after acknowledgement of its receipt by the servercomputer (130), depending on the quality of service required fordelivery of the message.

Next, the client middleware application (120) sends an update request(step 305) (that is, a request that makes a change to a resourcemanager), to each associated queue (115) of the client applications(110) that are in the group.

In response to the update request, messages that are present on eachqueue (115) are copied to an associated buffer, ready for sending acrossthe network (125) to the server computer (130).

Each client middleware application (120) sends an associated message tothe server computer (130) across the network (125).

The server computer (130) receives multiple messages from a number ofdifferent client applications (110). In response to receipt of themultiple messages, the server middleware (135) batches (step 310) themultiple requests under the single Transaction 2.

Any client application (110) that produces work shares a transactionwith each of the other client applications in its group that have alsoperformed some work. Each client application (110) in the group acceptsa single outcome of the transaction.

The server middleware (135) writes each message to the queue (140) and adecision associated with the transaction is computed (step 315). In anexample, the decision may be based on whether the write to the queue(140) succeeds.

In response to a decision being computed, if the decision is to committhe transaction (positive outcome to step 320), an acknowledgementidentifying the commit decision is sent (step 325) to each clientapplication (110) in the group.

If the decision is to rollback the transaction (negative outcome to step320), an acknowledgement identifying the rollback decision is sent (step330) to each client application (110) in the group. In an alternativeimplementation, if the decision is rollback, an acknowledgementidentifying the rollback decision is sent (step 330) to the individualclient whose message was not written to the queue (140). In anotheralternative implementation, the rollback decision may be indicated byterminating each client application's (or an individual clientapplication's) (110) connection.

The transaction coordinator forces a write of the disk in order to logthe decision. It should be noted that this may be computationallyintensive. In contrast to conventional processing where this disk writehad to occur on a per client basis causing enormous delay, the presentsubject matter associates the disk write with work undertaken by a groupof client applications, thereby providing improved efficiency.

A symmetrical process is followed for transmission of messages from theserver computer (130) to the client computer (105). Any combination ofthe delivery and confirmation flows for send and receipt of messages maybe combined in a shared transaction in the server computer (130).

The decision of the transaction is executed on behalf of each client inthe group.

The transaction associated with the group will fail if any one of thequeues (115) in the group is not able to successfully participate in thetransaction. Thus, although the present invention sacrifices sometransaction isolation, for example by grouping client computers suchthat work from across a set of client applications is obtained andprocessed or assigning as a single thread to a group, the presentsubject matter achieves scalability in a scenario where there areseveral (e.g., tens of thousands of) client computers.

Advantageously, the transaction that is initiated is not under theinfluence of a client application (110). This prevents a clientapplication (110) from choosing, at any time, to rollback thetransaction which would cause failure of the transaction across allclient applications (110). Thus, by implementing the grouping mechanismat the server middleware application (135) on the server computer (130),there is no danger of rollback due to client application involvement,which allows for a higher likelihood of each of the client applicationsbeing able to successfully commit.

Further, although transaction isolation is somewhat sacrificed, clientcomputers may selected for a group that produce the same or similarmessages to provide a higher likelihood of each of the clientapplications being able to successfully commit. Further, the clientmiddleware application (120) or the server middleware application (135)may be able to carry out some pre-checking before commencement of thetransaction in order to provide a higher likelihood of each of theclient applications being able to successfully commit (e.g., by checkingup front that each client application has an appropriate authorisationlevel required in order to participate in a transaction).

Although the group may be created arbitrarily, preferably the number ofclient computers is selected (e.g., using historical statistics) suchthat the number of client computers in a group is not too few (as thismay cause inefficiency in that disk writes are forced for a small amountof work).

It may further be advantageous to create more than one group so thatmulti-processors may be exploited and so that processing activity doesnot decrease significantly or come to a halt while a disk write takesplace.

If new client computers (105) connect to the server computer (130), theassociated client applications (110) may be added to one or more groups(e.g., existing groups or newly created groups). Groups may also bere-balanced by moving client applications (110) from one group toanother.

In scenarios where a few, heavyweight client devices connect to a serverdevice, a single thread per client computer waits for work from theclient application and a disk force is undertaken (per clientcomputer)—in this scenario, the client computer is typically busy due tothe relatively large amount of processing capacity and system resourcesit has. The present subject matter, on the other hand, is particularlysuited to a scenario where several lightweight client devices, which areless busy (and have a relatively small amount of processing capacity),connect to a server device. Although each lightweight client device isrelatively less busy, due to the grouping of several lightweight clientdevices, there is typically enough work to process without much waittime. The present subject matter is particularly suited to scenarioswhere there is a need for scalability and efficiency (e.g., where thereis a large number of client devices but where the data produced by eachclient device is small and infrequent). Efficiency gains may be obtainedtherefore, by grouping such client devices resulting in the total workproduced being of a significant amount. Examples of such scenarios areonline multi-user interactive (e.g., gaming/gambling) systems andutility monitoring systems.

Memory may be allocated efficiently wherein a pool of buffers is madeavailable for each group, and memory is allocated only to clientapplications (110) that have done some work.

It should be noted that, while the preceding description of the presentsubject matter describes certain actions as being performed by a servercomputer, these actions may alternatively be performed by a clientcomputer.

The present subject matter allows for the aggregation of the disk forcesand allows the use of a small number of threads when processing workfrom client applications. The transaction may use single phase or a twophase protocol. Preferably, in the case where the server computerreceives a message from only one client computer in the subset (e.g., inaccordance with a pre-configurable time threshold), processing is notheld up waiting for a second message. Instead, default processing isreverted to (e.g., wherein the message from the one client computer isprocessed under a transaction that is associated only with the oneclient computer).

As will be appreciated by one skilled in the art, aspects of the presentinvention may be embodied as a system, method or computer programproduct. Accordingly, aspects of the present invention may take the formof an entirely hardware embodiment, an entirely software embodiment(including firmware, resident software, micro-code, etc.) or anembodiment combining software and hardware aspects that may allgenerally be referred to herein as a “circuit,” “module” or “system.”Furthermore, aspects of the present invention may take the form of acomputer program product embodied in one or more computer readablemedium(s) having computer readable program code embodied thereon.

Any combination of one or more computer readable medium(s) may beutilized. The computer readable medium may be a computer readable signalmedium or a computer readable storage medium. A computer readablestorage medium may be, for example, but not limited to, an electronic,magnetic, optical, electromagnetic, infrared, or semiconductor system,apparatus, or device, or any suitable combination of the foregoing. Morespecific examples (a non-exhaustive list) of the computer readablestorage medium would include the following: an electrical connectionhaving one or more wires, a portable computer diskette, a hard disk, arandom access memory (RAM), a read-only memory (ROM), an erasableprogrammable read-only memory (EPROM or Flash memory), a portablecompact disc read-only memory (CD-ROM), an optical storage device, amagnetic storage device, or any suitable combination of the foregoing.In the context of this document, a computer readable storage medium maybe any tangible medium that can contain, or store a program for use byor in connection with an instruction execution system, apparatus, ordevice.

A computer readable signal medium may include a propagated data signalwith computer readable program code embodied therein, for example, inbaseband or as part of a carrier wave. Such a propagated signal may takeany of a variety of forms, including, but not limited to,electro-magnetic, optical, or any suitable combination thereof. Acomputer readable signal medium may be any computer readable medium thatis not a computer readable storage medium and that can communicate,propagate, or transport a program for use by or in connection with aninstruction execution system, apparatus, or device.

Program code embodied on a computer readable medium may be transmittedusing any appropriate medium, including but not limited to wireless,wireline, optical fiber cable, RF, etc., or any suitable combination ofthe foregoing.

Computer program code for carrying out operations for aspects of thepresent invention may be written in any combination of one or moreprogramming languages, including an object oriented programming languagesuch as Java®, Smalltalk, C++ or the like and conventional proceduralprogramming languages, such as the “C” programming language or similarprogramming languages. The program code may execute entirely on theuser's computer, partly on the user's computer, as a stand-alonesoftware package, partly on the user's computer and partly on a remotecomputer or entirely on the remote computer or server. In the latterscenario, the remote computer may be connected to the user's computerthrough any type of network, including a local area network (LAN) or awide area network (WAN), or the connection may be made to an externalcomputer (for example, through the Internet using an Internet ServiceProvider).

Aspects of the present invention have been described with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems) and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer program instructions. These computer program instructions maybe provided to a processor of a general purpose computer, specialpurpose computer, or other programmable data processing apparatus toproduce a machine, such that the instructions, which execute via theprocessor of the computer or other programmable data processingapparatus, create means for implementing the functions/acts specified inthe flowchart and/or block diagram block or blocks.

These computer program instructions may also be stored in acomputer-readable storage medium that can direct a computer or otherprogrammable data processing apparatus to function in a particularmanner, such that the instructions stored in the computer-readablestorage medium produce an article of manufacture including instructionswhich implement the function/act specified in the flowchart and/or blockdiagram block or blocks.

The computer program instructions may also be loaded onto a computer,other programmable data processing apparatus, or other devices to causea series of operational steps to be performed on the computer, otherprogrammable apparatus or other devices to produce a computerimplemented process such that the instructions which execute on thecomputer or other programmable apparatus provide processes forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof code, which comprises one or more executable instructions forimplementing the specified logical function(s). It should also be notedthat, in some alternative implementations, the functions noted in theblock may occur out of the order noted in the figures. For example, twoblocks shown in succession may, in fact, be executed substantiallyconcurrently, or the blocks may sometimes be executed in the reverseorder, depending upon the functionality involved. It will also be notedthat each block of the block diagrams and/or flowchart illustration, andcombinations of blocks in the block diagrams and/or flowchartillustration, can be implemented by special purpose hardware-basedsystems that perform the specified functions or acts, or combinations ofspecial purpose hardware and computer instructions.

A data processing system suitable for storing and/or executing programcode will include at least one processor coupled directly or indirectlyto memory elements through a system bus. The memory elements can includelocal memory employed during actual execution of the program code, bulkstorage, and cache memories which provide temporary storage of at leastsome program code in order to reduce the number of times code must beretrieved from bulk storage during execution.

Input/output or I/O devices (including but not limited to keyboards,displays, pointing devices, etc.) can be coupled to the system eitherdirectly or through intervening I/O controllers.

Network adapters may also be coupled to the system to enable the dataprocessing system to become coupled to other data processing systems orremote printers or storage devices through intervening private or publicnetworks. Modems, cable modems and Ethernet cards are just a few of thecurrently available types of network adapters.

The terminology used herein is for the purpose of describing particularembodiments only and is not intended to be limiting of the invention. Asused herein, the singular forms “a,” “an” and “the” are intended toinclude the plural forms as well, unless the context clearly indicatesotherwise. It will be further understood that the terms “comprises”and/or “comprising,” when used in this specification, specify thepresence of stated features, integers, steps, operations, elements,and/or components, but do not preclude the presence or addition of oneor more other features, integers, steps, operations, elements,components, and/or groups thereof.

The corresponding structures, materials, acts, and equivalents of allmeans or step plus function elements in the claims below are intended toinclude any structure, material, or act for performing the function incombination with other claimed elements as specifically claimed. Thedescription of the present invention has been presented for purposes ofillustration and description, but is not intended to be exhaustive orlimited to the invention in the form disclosed. Many modifications andvariations will be apparent to those of ordinary skill in the artwithout departing from the scope and spirit of the invention. Theembodiment was chosen and described in order to best explain theprinciples of the invention and the practical application, and to enableothers of ordinary skill in the art to understand the invention forvarious embodiments with various modifications as are suited to theparticular use contemplated.

What is claimed is:
 1. An apparatus for processing a unit of work,comprising: a network interface; and a processor programmed to: create aclient computer batch message transaction group comprising a pluralityof client computers from which messages are committed as a batchmessaging transaction to a single message reception queue; in responseto receiving separate messages over the network interface from at leasttwo of the plurality of client computers within the client computerbatch message transaction group, group the separate messages under thebatch messaging transaction as a single unit of work to commit to thesingle message reception queue; and compute a single batch transactioncommit decision based upon whether a write of each of the separatemessages grouped within the single unit of work to the single messagereception queue is successful.
 2. The apparatus of claim 1, where thesingle unit of work is not under control of a client applicationassociated with a client computer.
 3. The apparatus of claim 1, wherethe processor is further programmed to assign, via a server applicationof the apparatus, a single thread to the single unit of work.
 4. Theapparatus of claim 1, where the processor is further programmed to sendan acknowledgement identifying a batch transaction commitment to eachclient computer in the client computer batch message transaction groupif the single batch transaction commit decision comprises a decision tocommit the single unit of work comprising the grouped separate messagesto the single message reception queue.
 5. The apparatus of claim 1,where the processor is further programmed to send an acknowledgementidentifying a batch transaction rollback to each client computer in theclient computer batch message transaction group if the single batchtransaction commit decision comprises a decision to rollback the singleunit of work comprising the grouped separate messages.
 6. The apparatusof claim 1, where each of the plurality of client computers has aseparate communication channel with the apparatus via the networkinterface, and where the processor is further programmed to terminateeach separate communication channel associated with each client computerin the client computer batch message transaction group if the singlebatch transaction commit decision comprises a decision to rollback thesingle unit of work comprising the grouped separate messages.
 7. Theapparatus of claim 1, where, in being programmed to create the clientcomputer batch message transaction group comprising the plurality ofclient computers, the processor is programmed to create the clientcomputer batch message transaction group by selecting the plurality ofclient computers based upon a determination that each client applicationof each client computer in the plurality of client computers produces asame message or similar messages to each other client application. 8.The apparatus of claim 1, where the processor is further programmed toperform pre-processing checks on each client application of each clientcomputer in the client computer batch message transaction group beforecommencement of the single unit of work comprising receiving a clientidentifier via a server middleware application from each clientapplication of each client computer in the client computer batch messagetransaction group.
 9. The apparatus of claim 1, where, in beingprogrammed to create the client computer batch message transaction groupcomprising the plurality of client computers, the processor isprogrammed to create the client computer batch message transaction groupby selecting the plurality of client computers according to historicalstatistics to provide efficiency within the client computer batchmessage transaction group relative to individual client messageprocessing.
 10. The apparatus of claim 1, where more than one clientcomputer batch message transaction group is created.
 11. A computerprogram product for processing a unit of work, comprising: a computerreadable storage medium having computer readable program code embodiedtherewith, where the computer readable storage medium is not atransitory signal per se and where the computer readable program codewhen executed on a computer causes the computer to: create a clientcomputer batch message transaction group comprising a plurality ofclient computers from which messages are committed as a batch messagingtransaction to a single message reception queue; in response toreceiving separate messages from at least two of the plurality of clientcomputers within the client computer batch message transaction group,group the separate messages under the batch messaging transaction as asingle unit of work to commit to the single message reception queue; andcompute a single batch transaction commit decision based upon whether awrite of each of the separate messages grouped within the single unit ofwork to the single message reception queue is successful.
 12. Thecomputer program product of claim 11, where the single unit of work isnot under control of a client application associated with a clientcomputer.
 13. The computer program product of claim 11, where thecomputer readable program code when executed on the computer furthercauses the computer to assign, via a server application, a single threadto the single unit of work.
 14. The computer program product of claim11, where the computer readable program code when executed on thecomputer further causes the computer to send an acknowledgementidentifying a batch transaction commitment to each client computer inthe client computer batch message transaction group if the single batchtransaction commit decision comprises a decision to commit the singleunit of work comprising the grouped separate messages to the singlemessage reception queue.
 15. The computer program product of claim 11,where the computer readable program code when executed on the computerfurther causes the computer to send an acknowledgement identifying abatch transaction rollback to each client computer in the clientcomputer batch message transaction group if the single batch transactioncommit decision comprises a decision to rollback the single unit of workcomprising the grouped separate messages.
 16. The computer programproduct of claim 11, where each of the plurality of client computers hasa separate communication channel with the computer, and where thecomputer readable program code when executed on the computer furthercauses the computer to terminate each separate communication channelassociated with each client computer in the client computer batchmessage transaction group if the single batch transaction commitdecision comprises a decision to rollback the single unit of workcomprising the grouped separate messages.
 17. The computer programproduct of claim 11, where, in causing the computer to create the clientcomputer batch message transaction group comprising the plurality ofclient computers, the computer readable program code when executed onthe computer causes the computer to create the client computer batchmessage transaction group by selecting the plurality of client computersbased upon a determination that each client application of each clientcomputer in the plurality of client computers produces a same message orsimilar messages to each other client application.
 18. The computerprogram product of claim 11, where the computer readable program codewhen executed on the computer further causes the computer to performpre-processing checks on each client application of each client computerin the client computer batch message transaction group beforecommencement of the single unit of work comprising receiving a clientidentifier via a server middleware application from each clientapplication of each client computer in the client computer batch messagetransaction group.
 19. The computer program product of claim 11, where,in causing the computer to create the client computer batch messagetransaction group comprising the plurality of client computers, thecomputer readable program code when executed on the computer causes thecomputer to create the client computer batch message transaction groupby selecting the plurality of client computers according to historicalstatistics to provide efficiency within the client computer batchmessage transaction group relative to individual client messageprocessing.
 20. The computer program product of claim 11, where morethan one client computer batch message transaction group is created.